/**
 * 开发者调试工具 - 用于快速测试和调试
 */

// 清除认证状态并重新加载页面
export const resetAuthState = () => {
  localStorage.clear();
  sessionStorage.clear();
  window.location.reload();
};

// 查看当前认证状态
export const checkAuthState = () => {
  const authStore = localStorage.getItem('auth-store');
  console.log('当前认证状态:', authStore ? JSON.parse(authStore) : null);
  return authStore ? JSON.parse(authStore) : null;
};

// 在开发模式下添加到全局对象
if (process.env.NODE_ENV === 'development') {
  (window as any).resetAuthState = resetAuthState;
  (window as any).checkAuthState = checkAuthState;
  
  console.log('🔧 开发工具已加载:');
  console.log('  - resetAuthState(): 清除认证状态并重新加载');
  console.log('  - checkAuthState(): 查看当前认证状态');
  console.log('  - clearPWACache(): 清除PWA缓存');
}